package com.inch.web.controller;

import com.inch.web.exceptions.MyException1;
import com.inch.web.exceptions.MyException2;
import com.inch.web.exceptions.MyException3;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/exception")
public class ExceptionController {
    @RequestMapping("/test1")
    public String test1(int errorId) throws Exception{
        System.out.println("exception test1");
        if(errorId == 1){
            throw new MyException1();
        }
        if(errorId == 2){
            throw new MyException2();
        }
        if(errorId == 3){
            throw new MyException3();
        }
        return "Exception not found";
    }


}
